<!--
描述：考场管理信息-新增组件
开发人：hqj
开发日期：2019年3月11日
-->

<template lang="pug">
  kalix-dialog.user-add(bizKey="examRoom" ref="kalixBizDialog" v-bind:form-model.sync="formModel" v-bind:targetURL="targetURL")
    div.el-form(slot="dialogFormSlot")
      div.s-flex
        el-form-item.s-flex_item(label="考试科目" prop="subjectVal" v-bind:rules="rules.subjectVal" v-bind:label-width="labelWidth")
          kalix-dict-select(v-model="formModel.subjectVal" appName="enrolment" dictType="考试科目")
        el-form-item.s-flex_item(label="考场编号" prop="room" v-bind:rules="rules.room" v-bind:label-width="labelWidth")
          kalix-dict-select(v-model="formModel.room" appName="enrolment" dictType="考场编号")
      div.s-flex
        el-form-item.s-flex_item(label="座位号" prop="seatNo" v-bind:rules="rules.seatNo" v-bind:label-width="labelWidth")
          el-input(v-model="formModel.seatNo")
        el-form-item.s-flex_item(label="准考证号" prop="examCardNumber" v-bind:rules="rules.examCardNumber" v-bind:label-width="labelWidth")
          el-input(v-model="formModel.examCardNumber")
      div.s-flex
        el-form-item.s-flex_item(label="身份证号" prop="idCards" v-bind:label-width="labelWidth")
          el-input(v-model="formModel.idCards")
        el-form-item.s-flex_item(label="姓名" prop="name" v-bind:rules="rules.name" v-bind:label-width="labelWidth")
          el-input(v-model="formModel.name")
      div.s-flex
        el-form-item.s-flex_item(label="成绩备注" prop="attend" v-bind:rules="rules.attend" v-bind:label-width="labelWidth")
          kalix-dict-select(v-model="formModel.attend" appName="enrolment" dictType="成绩备注")
      div.s-flex
        el-form-item.s-flex_item(label="备注" prop="remarks" v-bind:label-width="labelWidth")
          el-input(v-model="formModel.remarks" type="textarea")
</template>

<script type="text/ecmascript-6">
  import FormModel from './model'
  import {ExamRoomURL} from '../config.toml'

  export default {
    name: 'ExamRoomAdd',
    data() {
      return {
        formModel: Object.assign({}, FormModel),
        rules: {
          subjectVal: [{required: true, message: '请选择考试科目', trigger: 'change'}],
          room: [{required: true, message: '请选择考场编号', trigger: 'change'}],
          seatNo: [{required: true, message: '请输入座位号', trigger: 'blur'}],
          examCardNumber: [{required: true, message: '请输入准考证号', trigger: 'blur'}],
          name: [{required: true, message: '请输入姓名', trigger: 'blur'}],
          attend: [{required: true, message: '请选择成绩备注', trigger: 'change'}]
        },
        targetURL: ExamRoomURL,
        labelWidth: '120px'
      }
    },
    components: {},
    created() {
    },
    methods: {}
  }
</script>

<style scoped lang="stylus">
  .el-form
    padding 30px 70px 30px 20px
</style>
